ioemu: config cleanup re AF_UNIX sockets on non-Windows
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 7 Feb 2008 09:19:12 +0000 (09:19 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 7 Feb 2008 09:19:12 +0000 (09:19 +0000)
Here is what I wrote in my submission to qemu upstream:

 The patch below makes it possible to disable AF_UNIX (unix-domain)
 sockets in host environments which do not define _WIN32, by adding
 -DNO_UNIX_SOCKETS to the compiler flags.  This is useful in the
 effectively-embedded qemu host which are going to be using for device
 emulation in Xen.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/ioemu/qemu_socket.h
tools/ioemu/vl.c
tools/ioemu/vnc.c

index 6e8bcce6cf4c5cc2842cf8b00e2f96ce6c713b58..d462d08d60ebe5e7662256ebce53f3e06fa52b48 100644 (file)
 #define EINTR       WSAEINTR
 #define EINPROGRESS WSAEINPROGRESS
 
+#ifndef NO_UNIX_SOCKETS
+#define NO_UNIX_SOCKETS 1
+#endif
+
 #else
 
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+
+#ifndef NO_UNIX_SOCKETS
 #include <sys/un.h>
+#endif
 
 #define socket_error() errno
 #define closesocket(s) close(s)
index 939149c46f11ea7db4a3336fff6a194a065a45a5..cb94bada098c07d6cfb6a50e802416df72e84449 100644 (file)
@@ -3127,7 +3127,7 @@ int parse_host_port(struct sockaddr_in *saddr, const char *str)
     return 0;
 }
 
-#ifndef _WIN32
+#ifndef NO_UNIX_SOCKETS
 static int parse_unix_path(struct sockaddr_un *uaddr, const char *str)
 {
     const char *p;
index 11cd94479f0e0c5c08a4192531cf667c555e852e..0dd78dd4b42511b1b2a8a30e57750cb4afacf619 100644 (file)
@@ -2401,7 +2401,7 @@ int vnc_display_open(DisplayState *ds, const char *display, int find_unused)
        }
 #endif
     }
-#ifndef _WIN32
+#ifndef NO_UNIX_SOCKETS
     if (strstart(display, "unix:", &p)) {
        addr = (struct sockaddr *)&uaddr;
        addrlen = sizeof(uaddr);